package ${mapperPackage};

import ${entityPackage}.${entityName};
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* ${tableComment}(table: ${tableName}) 数据持久层
* @author ${author}
* @since ${date}
*/
@Mapper
public interface ${mapperName}{

    /**
     * 单条插入新数据
     * @author ${author}
     * @since ${date}
     * @param param:
    */
    void insert(${entityName} param);

    /**
     * 批量插入
     * @author ${author}
     * @since ${date}
     * @param list:
    */
    void insertBatch(@Param("list") List<${entityName}> list);

<#if primaryColumn?? && (primaryColumn?size == 1)>
    /**
     * 根据ID删除记录
     * @author ${author}
     * @since ${date}
     * @param id:
    */
    void deleteById(${primaryColumn[0].javaType} id);

    /**
     * 根据ID更新记录
     * @author ${author}
     * @since ${date}
     * @param param:
    */
    void updateById(${entityName} param);

    /**
     * 根据ID选择性更新
     * @author ${author}
     * @since ${date}
     * @param param:
    */
    void updateSelectiveById(${entityName} param);

    /**
     * 根据ID查询记录
     * @author ${author}
     * @since ${date}
     * @param id:
     * @return ${entityPackage}.${entityName}
    */
    ${entityName} selectById(${primaryColumn[0].javaType} id);

</#if>
}
